package org.jkyec.lambda.basic;

import java.util.function.BiFunction;

public class BiFunctionTest {

	public static void main(String[] args) {
		BiFunction<String, Integer, User> userFunction = (username, age) -> { return new User(username, age); };
		
		System.out.println(userFunction.apply("wonderful girl", 29));
	}

}

class User {
	private String username;
	private Integer age;
	
	public User(String username, Integer age) {
		this.username = username;
		this.age = age;
	}
	
	public String getUsername() {
		return this.username;
	}
	
	public Integer getAge() {
		return this.age;
	}
	
	@Override
	public String toString() {
		return "username:" + this.username + ", age:" + this.age;
	}
}
